package alidns

import (
	alidns20150109 "github.com/alibabacloud-go/alidns-20150109/v4/client"
	openapi "github.com/alibabacloud-go/darabonba-openapi/v2/client"

	"aliyun-sdk/aliyun/credential"
)

func CreateClient(accessKeyid, accessKeySecret, endpoint string) (result *alidns20150109.Client, err error) {
	c, err := credential.CreateCredentials(accessKeyid, accessKeySecret)
	if err != nil {
		return nil, err
	}
	config := &openapi.Config{
		Credential: c,
		Endpoint:   &endpoint,
	}
	r, err := alidns20150109.NewClient(config)
	if err != nil {
		return nil, err
	}
	return r, nil
}
